package pers.zc.activiti.file;

import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.UUID;

/**
 * @description 文件随机读写操作 实例
 * @Author Lin FuYuan
 * @date 2020/4/29
 */
public class RandomAccessFileDemo {


    public static void main(String[] args) {

    }

    public static void testSave() throws IOException {
//        File file1 = new File("C:\\Users\\Administrator\\Desktop\\text\\RandomAccessFile.txt");
        File file = new File("xxxxx.txt");
        RandomAccessFile randomAccessFile = new RandomAccessFile(file,"rw");
        for (int i = 0; i <10000 ; i++) {
            randomAccessFile.writeChars(i +" :"+ UUID.randomUUID().toString());
        }

    }
}
